package com.nf.action;

import com.nf.service.MyTranscation;
import com.nf.service.存钱业务;
import com.nf.service.转账业务;
import com.nf.service.银行业务;

import java.lang.reflect.Proxy;

public class Test {
    public static void main(String[] args) {

        //银行业务 yewu = new 存钱业务();
        //yewu.go();
//        MyTranscation transcation = new MyTranscation(  new 转账业务() );
//        银行业务 yewu = (银行业务)Proxy.newProxyInstance(
//                Test.class.getClassLoader(),
//                new Class[]{银行业务.class},
//                transcation
//        );


        银行业务 yewu = (银行业务)Proxy.newProxyInstance(
                Test.class.getClassLoader(),
                new Class[]{银行业务.class},
                new MyTranscation(
                        new 转账业务()
                )
        );

        yewu.go();
    }
}
